package com.seashop.feign.fallback;

import com.seashop.feign.ThirdFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author moredln
 * @desc
 * @date 2020-08-11 14:20
 */
@Component
@Slf4j
public class ThirdFeignClientFallBack implements FallbackFactory<ThirdFeignClient> {

    @Override
    public ThirdFeignClient create(Throwable throwable) {
        return new ThirdFeignClient() {

            @Override
            public String sendMessage(String mobile, String code, String template) {
                log.info("调用三方服务发送短信失败");
                return null;
            }

        };
    }
}
